In my homework, my teacher gave us a piece of code asking,
"What would be the output of the following piece of code?"
The code is this:
Code:
include <stdio.h>
main() {
int x;
x=5;
while (x < 7);
{
printf("value of x is %d\n", x);
x = x + 1;
}
printf("final value of x is %d\n", x);
}
But when I run that, NOTHING happens! There is absolutely nothing on the screen. Not even "press any key to continue" or whatever. And "nothing" is not a choice...
I'm not asking for the answer, I'm just confused as to why nothing happens when apparently my teacher thinks it should. Am I doing something wrong?